|
|
I would like any help someone can give regarding a math problem in Povray.
I have included an image of what I'm trying to accomplish, however it's
never quite perfect. I'm trying to start with a small square in the center
(1x1 size) and increase its size to 5x5 and rotate the square as I go. I
want the squares to match up so each square corner perfectly matches up with
a line on the next larger square. Basically end up with a curving line made
of many squares. I'm doing it all by trail and error and never getting it
clean enough. The square image here is small and doesn't show the
discrepancies as much, but once it is increased in size it never lines up
cleanly. Is there a math formulae to create this? Is there a name for this
type of thing?
Thanks for any help!
Patrick Dugan
Here is the code I created for what it is worth:
#include "colors.inc"
#include "textures.inc"
#include "metals.inc"
#version 3.5;
global_settings {
assumed_gamma 2.2
max_trace_level 25
}
light_source {< 500, 500, -500> White * 1.0}
background {White}
camera {
location <0,0,-15>
look_at <0,0,3>
}
#declare WallTex = texture {pigment {Red} finish {ambient 0.5}}
#declare X = 1;
#declare Z = 0;
#declare Reduce = 0.11;
#declare WallFan =
union {
#while (X <= 5)
difference {
box {<-X,-X,-0.01>,<X,X,0.01> texture {WallTex}}
box {<-X+0.05,-X+0.05,-0.02>,<X-0.05,X-0.05,0.02> texture
{WallTex}}
rotate <0,0,Z>
}
#declare X = X + Reduce;
#declare Reduce = Reduce + 0.01;
#declare Z = Z + 4.725;
#end
}
object {WallFan}
// Size reference box behind wall fan
box {<-5,-5,-0.005>,<5,5,0.005> pigment {Blue}}
Post a reply to this message
Attachments:
Download 'RotatingSquares.jpg' (58 KB)
Preview of image 'RotatingSquares.jpg'
|
|